// 车辆校正类型
enum VehicleCalibrationType {
  // 陀螺仪校正
  gyroscope(0),

  // 俯仰角校正
  pitchAngle(1),

  // 翻滚角校正
  rollAngle(2);

  const VehicleCalibrationType(this.rawValue);
  final int rawValue;
}

// 车辆校正状态
enum VehicleCalibrationStatus {
  /// 空闲状态
  idle(0),

  /// 校正中
  calibrating(1),

  /// 繁忙
  busy(2),

  /// 校正成功
  calibrated(3),

  /// 校正失败
  calibrationFailed(4);

  const VehicleCalibrationStatus(this.rawValue);
  final int rawValue;

  static VehicleCalibrationStatus fromValue(int rawValue) {
    return VehicleCalibrationStatus.values.firstWhere(
        (e) => e.rawValue == rawValue,
        orElse: () => VehicleCalibrationStatus.idle);
  }
}
